define(function (require) {
var zsApp= require('app');
zsApp
.controller( 'videoupdateController',["$scope","$http","$state","$stateParams","$window","$timeout", "$rootScope",function($scope,$http,$state,$stateParams,$window,$timeout,$rootScope){
	
	
	$scope.gamedates = [
		{
			terminal:'pc',
			resourceaddress:'1',
			developmentversion:'2',
			encryptedversion:'3',
			encryptedpassword:'4',
			DRMversion:'5',
			DRMpassword:'6',
  		},
  		{
			terminal:'ipad',
			resourceaddress:'11',
			developmentversion:'22',
			encryptedversion:'33',
			encryptedpassword:'44',
			DRMversion:'55',
			DRMpassword:'66test',
  		}
	];
  	
  
	$scope.addtr = function(){
		$scope.gamedates.push({
			terminal:'',
			resourceaddress:'',
			developmentversion:'',
			encryptedversion:'',
			encryptedpassword:'',
			DRMversion:'',
			DRMpassword:'',
  		});
	}
	$scope.deletetr = function($index){
		
		if($scope.gamedates.length == 1){
			// 操作提示
				$rootScope.prompt = true;
				$rootScope.promptStatement = "最后一行了";
				$timeout(function () {
					$rootScope.prompt = false;
					$rootScope.success = false;
				}, 1500);
		
		}else{
			$scope.gamedates.splice($index,1);
		}
	}
	
	$scope.save = function(){
		console.log($scope.gamedates)	 
	}
}])
})